package com.example.demo.controller;

import com.example.demo.common.domain.Hotel;
import com.example.demo.service.HotelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class HotelController {
    @Autowired
    HotelService hotelService;
    @RequestMapping("/hotelinfo")
    public String hotelinfo(Model model,String hotelId){
        System.out.println("酒店ID:"+hotelId);
        Hotel hotel = hotelService.hotelinfo(hotelId);
        System.out.println(hotel);
        model.addAttribute("hotel",hotel);
        return "hotelinfo";
    }
}
